%% ************************************************************
clc;
clear;
close all;

x0=[1;0;1;0];
RelTol=1e-5;		%Relative tolerance
AbsTol=1e-6;		%Absolute tolerance
options=odeset('RelTol',RelTol,'AbsTol',AbsTol);

t0=0:0.001:200;

[t,x]=ode45('Engine', t0, x0, options);
X = (x(500:end,1));  %预处理
Y = (x(500:end,2));  %x(2)代表c
Z = (x(500:end,3)); 
W = (x(500:end,4))/1000; %U第四维
%% ************************************************************
%三维图像
%  figure(1);
% X = (x(500:end,1));  %x(1)代表i
% Y = (x(500:end,3));  %x(2)代表c
% Z = (x(500:end,2)); 
% % U = (x(500:end,2)); %U第四维
% plot3(X,Z,Y,'k');
% % xlabel('i_m') 
% % ylabel('u_c');
% % zlabel('x');
% xlabel('x') 
% ylabel('y');
% zlabel('z');
% set(get(gca,'XLabel'),'FontSize',16);%图上文字为8 point或小5号
% set(get(gca,'YLabel'),'FontSize',16);
% set(get(gca,'ZLabel'),'FontSize',16);
% set(get(gca,'TITLE'),'FontSize',15);
% set(gca,'fontsize',14);
%*******************************************************************
figure(1)
plot3(X,Y,W,'Color','black');
xlabel('x','fontsize',20,'fontname','times new roman','FontAngle','italic');
ylabel('y','fontsize',20,'fontname','times new roman','FontAngle','italic');
zlabel('w','fontsize',20,'fontname','times new roman','FontAngle','italic');
figure(2)
plot3(X,Z,Y,'Color','black');
xlabel('x','fontsize',20,'fontname','times new roman','FontAngle','italic');
ylabel('z','fontsize',20,'fontname','times new roman','FontAngle','italic');
zlabel('y','fontsize',20,'fontname','times new roman','FontAngle','italic');
figure(3)
plot3(W,X,Z,'Color','black');
xlabel('w','fontsize',20,'fontname','times new roman','FontAngle','italic');
ylabel('x','fontsize',20,'fontname','times new roman','FontAngle','italic');
zlabel('z','fontsize',20,'fontname','times new roman','FontAngle','italic');